<template>
    <div class="iframe-container">
        <detail-page ref="QuotedPriceManage" @eventOnTransmit="transmitValueOperate" />
        <el-drawer :visible.sync="drawer.show" direction="ltr" size="60%">
            <div class="quoted-price-contianer">
                <quoted-price :params="drawer.handle" @onEditEvent="editQuotedPriceOperate" />
            </div>
        </el-drawer>
    </div>
</template>

<script>
    import DetailPage from './quoted-price-manage.vue';
    import QuotedPrice from './quoted-price-edits.vue';

    import {
        Drawer, Dialog,
        MessageBox, Message
    } from 'element-ui';

    export default {
        components: {
            [Drawer.name]: Drawer, [Dialog.name]: Dialog,
            DetailPage, QuotedPrice
        },
        data() {
            return {
                drawer: {
                    show: false, handle: {}
                }
            }
        },
        methods: {
            transmitValueOperate(params) {
                console.log(params);
                this.drawer.show = true;
                this.drawer.handle = params;
            },
            editQuotedPriceOperate(params) {
                this.drawer.show = false;
                this.$refs.QuotedPriceManage.reloadFun(params);

            }
        },
        watch:{
            "drawer.show":function (oldVal, newVal,Ob) {
                console.log('logs ',oldVal)
                console.log('newVal ',newVal)
                this.$refs.QuotedPriceManage.reloadFun();
            }
        }
    }
</script>

<style lang="scss" scoped>
    .iframe-container {
        padding: 1.6rem 3.2rem;
        width: 414px;
        height: 736px;
    }

    .quoted-price-contianer {
        margin: 1.6rem 3.2rem;
        width: 414px;
        height: 736px;
        position: relative;
    }
</style>
